import java.util.Scanner;

public class SwitchCaseExpressTest2 {
    public static void main(String[] args) {
        //需求：从键盘输入1个星期的数字[1,7]，然后输出这个星期对应的单词
        Scanner input = new Scanner(System.in);

        System.out.print("请输入星期的数字[1,7]：");
        int week = input.nextInt();

        //如果switch-case用作表达式，那么default是必选的
        String weekName = switch (week) {
            case 1 -> "Monday";
            case 2 -> "Tuesday";
            case 3 -> "Wednesday";
            case 4 -> "Thursday";
            case 5 -> "Friday";
            case 6 -> "Saturday";
            case 7 -> "Sunday";
            default -> "输入有误！";
        };
        System.out.println("weekName = " + weekName);

        input.close();
    }
}
